package com.lin.lambda;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

//@Data
//@AllArgsConstructor
//@NoArgsConstructor

public class Info {
    private String name;
    private int age;

    public static int compareAge(Info o1, Info o2) {
        return o1.getAge() - o2.getAge();
    }

    public int compareAge2(Info o1, Info o2) {
        return o2.getAge() - o1.getAge();
    }

    public Info() {
    }

    public Info(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Info{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
